package com.lc.luzhengtang.adapter;

import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.luzhengtang.R;
import com.lc.luzhengtang.bean.OrderDetailBean;
import com.lc.luzhengtang.conn.Conn;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * 文 件 名: NewsListAdapter
 * 创 建 人: zhangyu
 * 创建日期: 16/12/24 19:55
 * 邮   箱: yuanchong121@gmail.com
 * 修改时间：
 * 修改备注：
 */
public class ConfirmListAdapter2 extends BaseQuickAdapter<OrderDetailBean.DataBean.GoodsBean, BaseViewHolder> {
    public ConfirmListAdapter2(List<OrderDetailBean.DataBean.GoodsBean> data) {

        super(R.layout.item_generate_order, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, OrderDetailBean.DataBean.GoodsBean item) {
        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) helper.convertView);
        Glide.with(mContext).load(Conn.HOST3 + item.getPicurl()).crossFade().error(R.mipmap.zhanwei).placeholder(R.mipmap.zhanwei).into((ImageView) helper.getView(R.id.img_shop_logo));
        helper.setText(R.id.text_num, "x" +item.getNum()  + "");
        /*if (TextUtils.isEmpty(item.getGoods_title())) {
            helper.setText(R.id.text_newstime, "没有标题呢");
        } else {
            helper.setText(R.id.text_newstime, item.getGoods_title());
        }
        helper.setText(R.id.text_newstitle, "¥" + item.getGoods_price());
        if (TextUtils.isEmpty(item.getNum())) {
            helper.setText(R.id.text_num, "x" + 0 + "");
        } else {
            helper.setText(R.id.text_num, "x" + item.getNum() + "");
        }*/
//        helper.setText(R.id.text_num,"x"+0+"");
    }


}
